package cc.yaomm.service.basic.controller.business.login;

import cc.yaomm.common.basic.domain.Response;
import cc.yaomm.service.basic.controller.business.BaseAdminController;
import cc.yaomm.service.basic.controller.business.login.biz.LoginAdminBiz;
import cc.yaomm.service.basic.controller.business.login.vo.LoginParamVO;
import cc.yaomm.service.basic.controller.business.login.vo.LoginResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * Created by XQL on 2021/6/9.
 */
@RestController
@RequestMapping("${apps.biz}")
@Api(tags = "登录相关接口")
@Slf4j
@Validated
public class LoginAdminController extends BaseAdminController {

    @Autowired
    private LoginAdminBiz loginAdminBiz;

    @PostMapping("login")
    @ApiOperation(value = "用户登录", notes = "用户登录")
    public Response<LoginResultVO> login(@RequestBody @Valid LoginParamVO paramVO) {
        return Response.success(loginAdminBiz.login(paramVO));
    }

}
